import { request } from 'umi';

export const move = (
  server: string,
  workerName: string,
  options: { x?: number; y?: number },
) => {
  return request(`${server}/ptz/move`, {
    params: { workerName, ...options },
  });
};

export const zoom = (server: string, workerName: string, zoom: number) => {
  return request(`${server}/ptz/move`, {
    params: { workerName, zoom },
  });
};

export const stop = (server: string, workerName: string) => {
  return request(`${server}/ptz/stop`, { params: { workerName } });
};

export const home = (server: string, workerName: string) => {
  return request(`${server}/ptz/home`, { params: { workerName } });
};
